package jp.sourceforge.akjrcp.dropsomething2.psp;

import java.io.File;
import java.util.Map;

import jp.sourceforge.akjrcp.dropsomething2.DropFileGenericParameterSetting;
import jp.sourceforge.akjrcp.ffmpeg.FFMpegOptions;

import org.apache.commons.lang.ArrayUtils;

public class PSPDropFileGenericParameterSetting extends DropFileGenericParameterSetting {
	
	/**
	 * 
	 * @param parameters
	 */
	public PSPDropFileGenericParameterSetting(Map<String, String> parameters) {
		super(parameters);
		/*
		 * customParams need for ignore arg
		 */
		customParams=(String[]) ArrayUtils.add(customParams, PSPConvertTabBuilder2.PSP_HQ);
		//customParams=(String[]) ArrayUtils.add(customParams, FFMpegOptions.OPTION_SHORTEST);
	}

	public Object clone(){
		PSPDropFileGenericParameterSetting param=new PSPDropFileGenericParameterSetting(cloneMap());
		return param;
	}
	
	public String toString(){
		String ret="";
		
		ret+=getName();
		ret+=" - ";
		
		String v=getString(DropFileGenericParameterSetting.INPUT_VIDEO1);
		if(v!=null){
			ret+="("+new File(v).getName();
			String a=getString(DropFileGenericParameterSetting.INPUT_AUDIO1);
			if(a!=null &&a.length()>0){
				ret+=","+new File(a).getName();
			}
			ret+=")";
		}
		ret+=" ";
		ret+=getString("vcodec");
		ret+="-";
		ret+=getString("b");
		ret+="-";
		String size=getString("s");
		if(size!=null){
			ret+="["+size+"]";
		}
		
		
		ret+=" ";
		int ch=getInt("ac");
		String channel="stereo";
		if(ch==1){
			channel="monoral";
		}
		ret+=getString("ab")+"-"+channel;
		
		return ret;
	}

}
